﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using UnityEngine;

// Token: 0x02000323 RID: 803
public static class AssetBundleCheck
{
	// Token: 0x170001EE RID: 494
	// (get) Token: 0x0600143D RID: 5181 RVA: 0x0008E23C File Offset: 0x0008C43C
	public static bool IsSimulation
	{
		get
		{
			return false;
		}
	}

	// Token: 0x0600143E RID: 5182 RVA: 0x0008E240 File Offset: 0x0008C440
	public static bool IsFile(string assetBundleName, string fileName = "")
	{
		return File.Exists(AssetBundleManager.BaseDownloadingURL + assetBundleName);
	}

	// Token: 0x0600143F RID: 5183 RVA: 0x0008E25C File Offset: 0x0008C45C
	public static string[] GetAllAssetName(string assetBundleName, bool _WithExtension = true, string manifestAssetBundleName = null)
	{
		string text;
		LoadedAssetBundle loadedAssetBundle = AssetBundleManager.GetLoadedAssetBundle(assetBundleName, out text, manifestAssetBundleName);
		AssetBundle assetBundle;
		if (loadedAssetBundle != null)
		{
			assetBundle = loadedAssetBundle.m_AssetBundle;
		}
		else
		{
			assetBundle = AssetBundle.LoadFromFile(AssetBundleManager.BaseDownloadingURL + assetBundleName);
		}
		string[] result;
		if (_WithExtension)
		{
			IEnumerable<string> allAssetNames = assetBundle.GetAllAssetNames();
			if (AssetBundleCheck.callback0 == null)
			{
				AssetBundleCheck.callback0 = new Func<string, string>(Path.GetFileName);
			}
			result = allAssetNames.Select(AssetBundleCheck.callback0).ToArray<string>();
		}
		else
		{
			IEnumerable<string> allAssetNames2 = assetBundle.GetAllAssetNames();
			if (AssetBundleCheck.callback1 == null)
			{
				AssetBundleCheck.callback1 = new Func<string, string>(Path.GetFileNameWithoutExtension);
			}
			result = allAssetNames2.Select(AssetBundleCheck.callback1).ToArray<string>();
		}
		if (loadedAssetBundle == null)
		{
			assetBundle.Unload(true);
		}
		return result;
	}

	// Token: 0x040018E7 RID: 6375
	[CompilerGenerated]
	private static Func<string, string> callback0;

	// Token: 0x040018E8 RID: 6376
	[CompilerGenerated]
	private static Func<string, string> callback1;
}
